﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartMathLibrary.Generator
{
    /// <summary>
    /// A specialization of the AbstractGenerator for functions, which includes two parameter.
    /// </summary>
    [Serializable]
    public abstract class AbstractTwoParameterFunctionGenerator : AbstractGenerator
    {
        /// <summary>
        /// The internal first interval of the function generator.
        /// </summary>
        private double firstInterval;

        /// <summary>
        /// The internal second interval of the function generator.
        /// </summary>
        private double secondInterval;

        /// <summary>
        /// The internal second current value of the function generator.
        /// </summary>
        protected double secondCurrentValue;

        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractTwoParameterFunctionGenerator"/> class.
        /// </summary>
        /// <param name="firstInterval">The first interval of the function generator.</param>
        /// <param name="secondInterval">The second interval of the function generator.</param>
        protected AbstractTwoParameterFunctionGenerator(double firstInterval, double secondInterval)
            : base()
        {
            this.firstInterval = firstInterval;
            this.secondInterval = secondInterval;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractTwoParameterFunctionGenerator"/> class.
        /// </summary>
        /// <param name="firstInterval">The first interval of the function generator.</param>
        /// <param name="secondInterval">The second interval of the function generator.</param>
        /// <param name="startvalue">The start value of the function generator.</param>
        protected AbstractTwoParameterFunctionGenerator(double firstInterval, double secondInterval, double startvalue)
            : base(startvalue)
        {
            this.firstInterval = firstInterval;
            this.secondInterval = secondInterval;
            this.secondCurrentValue = startvalue;
        }

        /// <summary>
        /// Gets the first current base of the generator.
        /// </summary>
        /// <value>The first current base of the generator.</value>
        public double FirstCurrentGeneratorBase
        {
            get { return currentValue; }
        }

        /// <summary>
        /// Gets the second current base of the generator.
        /// </summary>
        /// <value>The second current base of the generator.</value>
        public double SecondCurrentGeneratorBase
        {
            get { return secondCurrentValue; }
        }

        /// <summary>
        /// The first interval of the function generator.
        /// </summary>
        /// <value>The first interval of the function generator.</value>
        public double FirstInterval
        {
            get { return firstInterval; }
            set { firstInterval = value; }
        }

        /// <summary>
        /// The second interval of the function generator.
        /// </summary>
        /// <value>The second interval of the function generator.</value>
        public double SecondInterval
        {
            get { return secondInterval; }
            set { secondInterval = value; }
        }
    }
}